#include "asynchronousworker.h"
template <typename T>
AsynchronousWorker<T>::AsynchronousWorker( QObject *parent) : QThread(parent)
{
}

template <typename T>
void AsynchronousWorker<T>::run()
{
    //mutex.lock();
    ((objPtr)->*(funcPtr))();
    //mutex.unlock();
}

template <typename T>
void AsynchronousWorker<T>::setFunction(T *obj,void (T::*fptr)())
{
    mutex.lock();
    objPtr = obj;
    funcPtr = fptr;
    mutex.unlock();
}

template <typename T>
void AsynchronousWorker<T>::setSubTaskId(int step)
{
    mutex.lock();
    subTask = step;
    mutex.unlock();
}

template <typename T>
void AsynchronousWorker<T>::setTaskDescription(QString task)
{
    mutex.lock();
    taskDescription = task;
    mutex.unlock();
}
